package com.action;

import com.pojo.Student;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
public class HomeAction {

    @RequestMapping("/index")
    public String goHome(Model m)
    {
        m.addAttribute("sex",20);

        List list = new ArrayList();
        Student s1 = new Student(1,"aaa");
        Student s2 = new Student(2,"bbb");
        Student s3 = new Student(3,"ccc");
        list.add(s1);
        list.add(s2);
        list.add(s3);

        m.addAttribute("list",list);

        return "index";
    }
}
